cmake_minimum_required(VERSION 3.0.2)
project(slambot_control_vis)  # 项目名称，需与package.xml中的name一致

# 查找依赖包
find_package(catkin REQUIRED COMPONENTS
  roscpp
  sensor_msgs
  cv_bridge
  pcl_ros
  pcl_conversions
)

# 查找PCL和OpenCV
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)

# 配置catkin包
catkin_package(
  CATKIN_DEPENDS 
    roscpp 
    sensor_msgs 
    cv_bridge 
    pcl_ros 
    pcl_conversions
)

# 包含头文件目录
include_directories(
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
)

# 添加PCL编译选项
add_definitions(${PCL_DEFINITIONS})

# 生成可执行文件（假设你的cpp文件名为slambot_control_vis.cpp）
add_executable(${PROJECT_NAME}_node src/slambot_control_vis.cpp)

# 链接依赖库
target_link_libraries(${PROJECT_NAME}_node
  ${catkin_LIBRARIES}
  ${PCL_LIBRARIES}
  ${OpenCV_LIBRARIES}
)

# 安装可执行文件（可选）
install(TARGETS ${PROJECT_NAME}_node
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
